<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>总持续时间可被 60 整除的歌曲</title>
</head>
<body>
  <script>
    function fn(time) {
      var x = 0
      for (var i = 0; i < time.length; i++) {
        for (var j = i + 1; j < time.length; j++) {
          var arr = (time[i] + time[j]) % 60
          if (arr == 0) {
            x++
          }
        }
      }
      return x;
    }
    console.log(fn([30, 20, 150, 100, 40]))
  </script>
</body>
</html>